package com.szqhyxj.youxiangju.biz.receipt.fail;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.KeyEvent;
import android.widget.TextView;

import com.szqhyxj.youxiangju.BaseActivity;
import com.szqhyxj.youxiangju.R;
import com.szqhyxj.youxiangju.biz.receipt.ReceiptActivity;
import com.szqhyxj.youxiangju.sys.components.NavigationBar;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by leung on 2018/11/25.
 */

public class ReceiptFailActivity extends BaseActivity implements NavigationBar.NavigationBarListener {

    @BindView(R.id.navigationBar)
    NavigationBar navigationBar;
    @BindView(R.id.failtetle)
    TextView failtetle;

    public static void start(Activity activity, String fail) {
        Intent intent = new Intent();
        intent.setClass(activity, ReceiptFailActivity.class);
        intent.putExtra("fail", fail);
        activity.startActivity(intent);

    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_receipt_fail);
        ButterKnife.bind(this);
        failtetle.setText(getIntent().getStringExtra("fail")+"");
    }

    @OnClick(R.id.back)
    public void onClick() {
        ReceiptActivity.start(this);
        finish();
    }

    @Override
    public void navigationLeft() {
        ReceiptActivity.start(this);
        finish();
    }

    @Override
    public void navigationRight() {

    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK) {
            ReceiptActivity.start(this);
            finish();
        }
        return super.onKeyDown(keyCode, event);
    }
}
